import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
import type { ResultTable } from "./result/result_table";

const basePath = "work_order/";

export const WorkOrderList = (data?: object) => {
  return http.request<ResultTable>("post", baseUrlApi(basePath + "list"), {
    data
  });
};

export const WorkOrderAdd = (data?: object) => {
  return http.request<ResultTable>("post", baseUrlApi(basePath + "add"), {
    data
  });
};

export const WorkOrderUpdate = (data?: object) => {
  return http.request<ResultTable>("post", baseUrlApi(basePath + "update"), {
    data,
    headers: {
      "Content-Type": "multipart/form-data" // 设置请求头为 multipart/form-data
    }
  });
};

export const WorkOrderReply = (data?: object) => {
  return http.request<ResultTable>("post", baseUrlApi(basePath + "reply"), {
    data
  });
};
